package com.wb3.organizer.action;

import java.util.Map;

import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

public class LogoffAction extends ActionSupport implements SessionAware {

	private Logger log = Logger.getLogger(LogoffAction.class);

	private Map<String, Object> session;

	private String msg;

	public void setSession(Map<String, Object> inSession) {
		this.session = inSession;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	@Override
	public String execute() throws Exception {
		log.info("\n\n----------------------------------------------------------\n");

		log.debug("LogoffAction.execute()...\n");
		msg = "你已经退出";
		session.remove("account");
		session.clear();
		
		log.debug("LogoffAction.execute() Done\n");
		return SUCCESS;
	}

}
